1. Field of the Invention
The present invention relates to a method and an apparatus for binary image coding, and particularly to a method and an apparatus for data compression to be executed with reference to mixed binary images including documents, paintings, calligraphic works, diagrams, halftone images and photographs.
2. Description of the Related Art
An MH (Modified Huffman) coding method or an MR (Modified READ, Modified Relative Element Address Designate) coding method applied in the G3 facsimile industry is known as a typical coding method for binary images in which each pixel is represented by numeral 0 or 1. These methods are established by CCITT (Comite Consultatif Internationale de Telegraphique et Telephonique, International Telegraph and Telephone Consultative Committee) as international standards. Although the MH coding and the MR coding are suitable for use in facsimile transmission of business documents, their function is not satisfactory for executing the high definition transmission of mixed binary images which includes text, diagrams, halftone images or photographs, and is not appropriate for displaying images on the user's terminal when it is necessary in such operations as image data base retrieval.
Therefore, a JBIG (Joint Bi-Level Image coding experts Group) method has been proposed for a coding system as an international standard which deals with binary static image data and which can encode the data with a high compression rate even when the data includes mixed texts, diagrams, halftone images or photographs, and can also perform the progressive display on the user's terminal. A binary image data compression apparatus according to the JBIG coding method is composed of, in brief, a modeling part for performing modeling activity according to the binary Markov model which refers to 10 pixels surrounding a current pixel to be encoded and an encoder for performing entropy encoding. As for entropy encoding, an arithmetic encoding method is employed. It was decided to use a QM code (hereinafter referred to as the QM-Code) developed based on the Q code and Mel code as a standard code. The JBIG method will be further described below with reference to FIGS. 1 and 2.
FIG. 1 illustrates a conventional binary image data compression apparatus according to the JBIG method. The figure shows the input binary image scanning in progress by a raster scanning method which scans the image pixel by pixel from the upper left of the image. In FIG. 1, x.sub.i,j represents a pixel (attentional pixel) to be inputted to the j-th place on the i-th line. This apparatus comprises a correlation calculation part 91 for calculating correlation between images, a pixel displacement position decision part 92 for displacing a pixel which has a strong correlation with the attentional pixel to a related position, a reference data preparation part 93 for preparing reference data to be used in Markov model encoding activity and a QM coder 94 for practically performing encoding of the data and outputting encoded output signals. When the attentional pixel x.sub.i,j is encoded by the QM coder 94, the Markov model encoding is performed in this apparatus based on the reference data to be outputted from the reference data preparation part 93. Also in this activity, 10 pixels in the neighborhood of the attentional pixel to be encoded (10 nearby pixels) are used as the reference data for performing the Markov model encoding. FIG. 2 illustrates the positional relationship between the attentional pixel x.sub.i,j and the 10 pixels near the attentional pixel. This apparatus is arranged so as to be able to select only one pixel of the reference data for changing the pixel position depending on the degree of correlation between images. According to a position changing method, a pixel to be referred to located at position A of FIG. 2 is moved to a position of another pixel selected from among pixels having a strong correlation with the attentional pixel. More particularly, one of the pixels to be referred to for the Markov model encoding of the attentional pixel is changed from the pixel at A of FIG. 2 to another pixel which has a strong correlation with the attentional pixel by the pixel displacement position decision part 92 depending on data computed by the correlation calculation part 91 using the data of peripheral pixels. The substituted pixel is referred to for the encoding together with the remaining 9 pixels of the above 10 nearby pixels. However, the information of the pixel position concerned with displacement needs to be transmitted from an encoder to a decoder.
The conventional JBIG method for applying the Markov model encoding based on the QM-code has the following problems:
(1) Since the Markov model encoding utilizes 10 nearby pixels as reference data, the compression efficiency of binary images is high when the binary images are documents, calligraphic works or diagrams, but the compression efficiency falls to a low level when pseudo-halftone images are produced by an error diffusion method. PA0 (2) In the Markov model encoding, the position of only one pixel among the 10 nearby pixels of the reference data is allowed to shift to another position having a strong correlation with the attentional pixel, but this process is unsatisfactory for an image in which binary image data has a specific period such as a halftone image or a pseudo-halftone image produced by the ordered dither method. More particularly, in the case of binary image data having the specific period as described above, several pixels spaced by the specific period from the attentional pixel x.sub.i,j each have the same strong correlation with the attentional pixel, with the result that the displacement of only one pixel position is unsatisfactory for this case. PA0 (3) With respect to the reference data, the relative position of the substituted pixel with the attentionl pixel can be changed for each line of the image data and cannot be channged within the same line. However, when there is a combination of documents and pseudo-halftone images involved in the binary images, it is common for the above documents and pseudo-halftone images to be mixed on the same line. In this case, it is impossible to change the pixel position of the reference data. PA0 (4) When a pixel position is changed, in order to obtain the position to which the pixel is displaced, it is necessary to calculate the correlation of the pixel with surrounding pixels or the Markov model entropy of the pixel. Since these operations entail a huge amount of calculation requiring additional memory with a large capacity for temporary storage of data, the practical application of such a method necessitates a large and costly system.